/* Reset some basic styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* General Body Styling */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
    color: #333;
    line-height: 1.6;
}

/* Header Styling */
header {
    background-color: #4CAF50;
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 1.8em;
    font-weight: bold;
}

header .profile {
    display: flex;
    align-items: center;
    cursor: pointer;
}

header .profile img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-right: 10px;
}

/* Container Styling */
.container {
    max-width: 900px;
    margin: 30px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.container h1 {
    font-size: 1.6em;
    margin-bottom: 20px;
}

/* Post Form Styling */
form {
    display: flex;
    flex-direction: column;
}

textarea {
    resize: vertical;
    height: 200px;
    width: 100%;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

textarea:focus {
    border-color: #4CAF50;
    outline: none;
}

.file-input-container {
    margin-bottom: 20px;
}

input[type="file"] {
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 14px;
}

button[type="submit"] {
    padding: 12px 25px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button[type="submit"]:hover {
    background-color: #45a049;
}

/* Floating Button */
.floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #4CAF50;
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s;
}

.floating-btn:hover {
    background-color: #45a049;
}

/* Like and Dislike Button Styling */
button.like, button.dislike {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: #4CAF50;
    transition: color 0.3s;
}

button.like:hover, button.dislike:hover {
    color: #45a049;
}

button.like.liked {
    color: #f44336; /* 红色点赞 */
}

button.dislike.disliked {
    color: #f44336; /* 红色踩 */
}

/* Search Bar */
.search-bar {
    display: flex;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px 0 0 5px;
    background-color: #fafafa;
}

.search-bar button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
}

.search-bar button:hover {
    background-color: #45a049;
}
/* 只针对 main 页面中的帖子和头像 */
.main-page .post {
    position: relative;  /* 使帖子容器能够作为头像的参考 */
    padding: 20px;
    border: 1px solid #ddd;
    margin-bottom: 20px;
    border-radius: 10px;
    background-color: #f9f9f9;
}

/* 帖子右下角的头像 */
.main-page .post-avatar img {
    width: 40px;           /* 头像大小 */
    height: 40px;          /* 头像大小 */
    border-radius: 50%;    /* 使图片变成圆形 */
    border: 2px solid white; /* 给头像加白色边框 */
    position: absolute;    /* 绝对定位 */
    bottom: 10px;          /* 距离底部10px */
    right: 10px;           /* 距离右侧10px */
    object-fit: cover;     /* 保持图片比例，裁剪多余部分 */
}

/* 仅在 main 页面应用的 header 头像样式 */
.main-page header .profile img {
    width: 40px; /* 增加头像尺寸 */
    height: 40px; /* 增加头像尺寸 */
}

/* 仅在 main 页面应用的帖子作者头像样式 */
.main-page .post .info .author img {
    width: 30px;  /* 更小的头像尺寸 */
    height: 30px;  /* 更小的头像尺寸 */
    border-radius: 50%;  /* 圆形头像 */
}

